#ifndef __SMS_H__
#define __SMS_H__

#define SMS_VALIDITY_PERIOD     0           //SMS Validity Period Is 5 minutes

__packed typedef struct
{
    INT8U SMSC_AddressLength;               //length fo the SMSC information
    INT8U SMSC_AddressType;                 //type of address of SMSC
    INT8U SMSC_Address[20];                 //service center number
    INT8U FirstOctet;                       //first octet of the this SMS-DELIVER message
    INT8U AddressLength;                    //length of the sender number
    INT8U AddressType;                      //type of address of sender number
    INT8U Address[20];                      //sender number
    INT8U PID;                              //protocal identifier
    INT8U DCS;                              //data coding scheme
    INT8U SCTS[7];                          //Time stamp
    INT8U UserDataLength;                   //User data length,length of message.
    INT8U UserData[180];                    //user data,message
}PDU_SMS_RECEIVE;

__packed typedef struct
{
    INT8U SMSC_AddressLength;               //length fo the SMSC information
    INT8U SMSC_AddressType;                 //type of address of SMSC
    INT8U SMSC_Address[20];                 //service center number
    INT8U FirstOctet;                       //first octet of the this SMS-DELIVER message
    INT8U MessageReference;                 //
    INT8U AddressLength;                    //length of the sender number
    INT8U AddressType;                      //type of address of sender number
    INT8U Address[20];                      //sender umber
    INT8U PID;                              //protocal identifier
    INT8U DCS;                              //data coding scheme
    INT8U ValidityPeriod;                   //
    INT8U UserDataLength;                   //User data length,length of message in decimal
    INT8U UserData[180];                    //user data,message
}PDU_SMS_SEND;

void ReceiveToPDUForm(INT8U *buff, PDU_SMS_RECEIVE *SMS_Receive);
unsigned char GetSMSData(PDU_SMS_RECEIVE *SMS_Receive, unsigned char *message, int *MessageLength);
unsigned char MsgToSendBuff(unsigned char SmscAddressFrom, unsigned char *SmscAddress, unsigned char *ReceivePhoneNo,
                            unsigned char *Message, int MessageLength, unsigned char Is8bitsForm, PDU_SMS_SEND *pdu_sms_send,
                            unsigned char *MessageSend, int *MessageSendLength, int *size);
unsigned char GetSMSSendAddr(PDU_SMS_RECEIVE *SMS_Receive, unsigned char *SendAddress, int *AddressLength);

#endif

